import { removeToken } from '../utils/auth';

export function loginSuccess(state, info) {
  state.userInfo = info;
  localStorage.userInfo = JSON.stringify(info);
}

export function showLogin(state, isShow) {
  state.showLogin = isShow;
  state.showRegist = false;
}

export function showRegist(state) {
  state.showLogin = false;
  state.showRegist = true;
}

export function logout(state) {
  state.userInfo = null;
  removeToken();
}
